import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

/**
 * 导航初步使用
 */
class MyApp13 extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: "FirstScreen",
      home: FirstScreen(),
    );
  }
}

class FirstScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("first screen button "),
      ),
      body: Center(
        child: RaisedButton(
          child: Text("产看商品详情页"),
          onPressed: () {
            Navigator.push(context,
                MaterialPageRoute(builder: (context) => SecondScreen()));
          },
        ),
      ),
    );
  }
}

class SecondScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("second screen product detail "),
      ),
      body: Center(
        child: RaisedButton(
          child: Text(" return "),
          onPressed: () {
            Navigator.pop(context);
          },
        ),
      ),
    );
  }
}
